////////////////////////////////////////////////////////////////////////////////////////////////////
/// @file   CollabRCBot\ComputationalTreeNodeVisitor.h
///
/// @brief  Declares the CollabRC::Bot::AI::ComputationalTreeNodeVisitor class
////////////////////////////////////////////////////////////////////////////////////////////////////

#pragma once

namespace CollabRC
{
    namespace Bot
    {
        namespace AI
        {
            class ComputationalTreeNode;
            class OperationTreeNode;
            class ConstantTreeNode;
            class AdditionTreeNode;
            class SubtractionTreeNode;
            class MultiplicationTreeNode;
            class DivisionOperationTreeNode;
            class ArithmeticMeanTreeNode;
            class GeometricMeanTreeNode;
            class LhsTreeNode;
            class RhsTreeNode;
            class WordChoiceGene;

            template <class C, class T> class MemberVariableTreeNode;
            template <class T> class VariableTreeNode;


            /**
             * @brief Interface for a visitor object which
             * allows for operations to be performed on ComputationalTreeNode objects.
             *
             * A visitor traverses over all branches of an operation automatically.
             * This allows for easy collection of object-specific information at runtime.
             * Each function in the interface is provided with a default implementation
             * for ease of use.
             * @version $Id$
             * @author Matthew P. Del Buono
             */
            class ComputationalTreeNodeVisitor
            {
            public:
                /** @brief Destroys this ComputationalTreeNodeVisitor object and all associated resources */
                inline virtual ~ComputationalTreeNodeVisitor(void)
                {
                }

#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4100) // warning C4100: 'node' : unreferenced formal parameter
#endif // defined _MSC_VER
                /**
                 * @brief Visitor callback for default implementations of a 
                 * ComputationalTreeNode object. This should only be implemented
                 * in rare circumstances.
                 * @param node the abstracted representation of the ComputationalTreeNode object
                 */
                inline virtual void Visit(ComputationalTreeNode& node) { };


                inline virtual void Visit(OperationTreeNode& node) { };
                inline virtual void Visit(ConstantTreeNode& node)  { };
                inline virtual void Visit(VariableTreeNode<float>& node) { };
                inline virtual void Visit(VariableTreeNode<int>& node) { };
                inline virtual void Visit(MemberVariableTreeNode<WordChoiceGene, float>& node) { };
                inline virtual void Visit(AdditionTreeNode& node) { };
                inline virtual void Visit(SubtractionTreeNode& node) { };
                inline virtual void Visit(MultiplicationTreeNode& node) { };
                inline virtual void Visit(DivisionOperationTreeNode& node) { };
                inline virtual void Visit(ArithmeticMeanTreeNode& node) { };
                inline virtual void Visit(GeometricMeanTreeNode& node) { };
                inline virtual void Visit(LhsTreeNode& node) { };
                inline virtual void Visit(RhsTreeNode& node) { };
#ifdef _MSC_VER
#pragma warning(pop)
#endif
            };
        }
    }
}